package com.joyintech.enums;

/**
 * 产品类别 贵金属
 */
public enum PdtTyEnum {

    ZERO("0","投资类"),
    ONE("1","民俗类"),
    TWO("2","收藏类"),
    THREE("3","线下专享"),
    FOUR("4","品牌金"),
    FIVE("5","钱币类"),
    SIX("6","主题类"),
    SEVEN("7","题材类"),
    EIGHT("8","节庆类"),
    NINE("9","长安金"),
    B("B","婚庆"),
    C("C","礼赠"),
    D("D","家族传承"),
    E("E","首饰类"),
    F("F","摆件类"),
    NO("16","未知"),
    ;


    private String code;
    private String name;

    PdtTyEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static PdtTyEnum getNameByCode(String code) {
        for (PdtTyEnum codeEnum : PdtTyEnum.values()) {
            if (codeEnum.getCode().equals(code)) {
                return codeEnum;
            }
        }
        return PdtTyEnum.NO;
    }
}
